#ifndef _MAX30102_H_
#define _MAX30102_H_

#include "driver/i2c_master.h"

typedef struct max30102_t *max30102_handle_t;

max30102_handle_t max30102_init(i2c_master_bus_handle_t i2c_bus);
esp_err_t max30102_read_fifo(max30102_handle_t max30102, float *pun_red_led, float *pun_ir_led);
esp_err_t max30102_start(max30102_handle_t max30102);
esp_err_t max30102_stop(max30102_handle_t max30102);
// 读取心率和血氧饱和度
esp_err_t max30102_read_data(max30102_handle_t max30102);

esp_err_t max30102_get_bmp_spo2(max30102_handle_t max30102, uint16_t *bpm, float *spo2);

#endif // _MAX30102_H_